package org.example.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.example.po.User;
import org.springframework.web.bind.annotation.*;

/**
 * @author liyishan
 * @date 2023/7/18 17:58
 * @apiNote
 */
@Api("test")
@RestController
@RequestMapping("test")
public class TestController {

    @ApiOperation(value = "demo")
    @GetMapping("demo")
    public String demo(){
        System.out.println("demo");
        return "demo";
    }


    @ApiOperation(value = "demo1")
    @GetMapping("demo1")
    public String demo1(@RequestParam("name") String name){
        System.out.println("demo1");
        return "demo1"+name;
    }

    @PostMapping("demo2")
    public User demo2(@RequestBody User name){
        return name;
    }
}
